﻿

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head" runat="server">
	<meta charset="utf-8" />
    <title>注册</title>
<style>

html, body
{
    height: 100%;
}

body
{
    font: 12px 'Lucida Sans Unicode', 'Trebuchet MS', Arial, Helvetica;    
    margin: 0;
    background-color: #d9dee2;
    background-image: -webkit-gradient(linear, left top, left bottom, from(#ebeef2), to(#d9dee2));
    background-image: -webkit-linear-gradient(top, #ebeef2, #d9dee2);
    background-image: -moz-linear-gradient(top, #ebeef2, #d9dee2);
    background-image: -ms-linear-gradient(top, #ebeef2, #d9dee2);
    background-image: -o-linear-gradient(top, #ebeef2, #d9dee2);
    background-image: linear-gradient(top, #ebeef2, #d9dee2);    
}

/*--------------------*/

#login
{
    background-color: #fff;
    background-image: linear-gradient(top, #fff, #eee);
    height: 600px;
    width: 400px;
    margin: -150px 0 0 -230px;
    padding: 30px;
    position: absolute;
    top: 33%;
    left: 50%;
    z-index: 0;
    -moz-border-radius: 3px;
    -webkit-border-radius: 3px;
    border-radius: 3px;  
    -webkit-box-shadow:
          0 0 2px rgba(0, 0, 0, 0.2),
          0 1px 1px rgba(0, 0, 0, .2),
          0 3px 0 #fff,
          0 4px 0 rgba(0, 0, 0, .2),
          0 6px 0 #fff,  
          0 7px 0 rgba(0, 0, 0, .2);
    -moz-box-shadow:
          0 0 2px rgba(0, 0, 0, 0.2),  
          1px 1px   0 rgba(0,   0,   0,   .1),
          3px 3px   0 rgba(255, 255, 255, 1),
          4px 4px   0 rgba(0,   0,   0,   .1),
          6px 6px   0 rgba(255, 255, 255, 1),  
          7px 7px   0 rgba(0,   0,   0,   .1);
    box-shadow:
          0 0 2px rgba(0, 0, 0, 0.2),  
          0 1px 1px rgba(0, 0, 0, .2),
          0 3px 0 #fff,
          0 4px 0 rgba(0, 0, 0, .2),
          0 6px 0 #fff,  
          0 7px 0 rgba(0, 0, 0, .2);
}

#login:before
{
    content: '';
    position: absolute;
    z-index: -1;
    border: 1px dashed #ccc;
    top: 5px;
    bottom: 5px;
    left: 5px;
    right: 5px;
    -moz-box-shadow: 0 0 0 1px #fff;
    -webkit-box-shadow: 0 0 0 1px #fff;
    box-shadow: 0 0 0 1px #fff;
}

/*--------------------*/

h1
{
    text-shadow: 0 1px 0 rgba(255, 255, 255, .7), 0px 2px 0 rgba(0, 0, 0, .5);
    text-transform: uppercase;
    text-align: center;
    color: #666;
    margin: 0 0 30px 0;
    letter-spacing: 4px;
    font: normal 26px/1 Verdana, Helvetica;
    position: relative;
}

h1:after, h1:before
{
    background-color: #777;
    content: "";
    height: 1px;
    position: absolute;
    top: 15px;
    width: 120px;   
}

h1:after
{ 
    background-image: -webkit-gradient(linear, left top, right top, from(#777), to(#fff));
    background-image: -webkit-linear-gradient(left, #777, #fff);
    background-image: -moz-linear-gradient(left, #777, #fff);
    background-image: -ms-linear-gradient(left, #777, #fff);
    background-image: -o-linear-gradient(left, #777, #fff);
    background-image: linear-gradient(left, #777, #fff);      
    right: 0;
}

h1:before
{
    background-image: -webkit-gradient(linear, right top, left top, from(#777), to(#fff));
    background-image: -webkit-linear-gradient(right, #777, #fff);
    background-image: -moz-linear-gradient(right, #777, #fff);
    background-image: -ms-linear-gradient(right, #777, #fff);
    background-image: -o-linear-gradient(right, #777, #fff);
    background-image: linear-gradient(right, #777, #fff);
    left: 0;
}

/*--------------------*/

fieldset
{
    border: 0;
    padding: 0;
    margin: 0;
}

/*--------------------*/

#inputs input
{
    background: #f1f1f1 url(images/login-sprite.png) no-repeat;
    padding: 15px 15px 15px 30px;
    margin: 0 0 10px 0;
    width: 353px; /* 353 + 2 + 45 = 400 */
    border: 1px solid #ccc;
    -moz-border-radius: 5px;
    -webkit-border-radius: 5px;
    border-radius: 5px;
    -moz-box-shadow: 0 1px 1px #ccc inset, 0 1px 0 #fff;
    -webkit-box-shadow: 0 1px 1px #ccc inset, 0 1px 0 #fff;
    box-shadow: 0 1px 1px #ccc inset, 0 1px 0 #fff;
}

#username
{
    background-position: 5px -2px !important;
}

#password
{
    background-position: 5px -52px !important;
}

#age
{
    background-position: 5px -82px !important;
}

#inputs input:focus
{
    background-color: #fff;
    border-color: #e8c291;
    outline: none;
    -moz-box-shadow: 0 0 0 1px #e8c291 inset;
    -webkit-box-shadow: 0 0 0 1px #e8c291 inset;
    box-shadow: 0 0 0 1px #e8c291 inset;
}

/*--------------------*/
#actions
{
    margin: 25px 0 25px 0;
}

#submit
{		
    border-left: 1px solid #e3a037;
        border-right: 1px solid #e3a037;
        border-top: 1px solid #d69e31;
        border-bottom: 1px solid #d5982d;
        background-color: #ffb94b;
    background-image: linear-gradient(top, #fddb6f, #ffb94b);
        -moz-border-radius: 3px;
        -webkit-border-radius: 3px;
        border-radius: 3px;
    
        text-shadow: 0 1px 0 rgba(255,255,255,0.5);
    
        -moz-box-shadow: 0 0 1px rgba(0, 0, 0, 0.3), 0 1px 0 rgba(255, 255, 255, 0.3) inset;
        -webkit-box-shadow: 0 0 1px rgba(0, 0, 0, 0.3), 0 1px 0 rgba(255, 255, 255, 0.3) inset;
        box-shadow: 0 0 1px rgba(0, 0, 0, 0.3), 0 1px 0 rgba(255, 255, 255, 0.3) inset;    
    
        float: left;
        height: 35px;
        padding: 0;
        width: 120px;
        cursor: pointer;
        font: bold 15px Arial, Helvetica;
        color: #8f5a0a;
        margin-left: 94px;
    }

#submit:hover,#submit:focus
{		
    background-color: #fddb6f;
    background-image: -webkit-gradient(linear, left top, left bottom, from(#ffb94b), to(#fddb6f));
    background-image: -webkit-linear-gradient(top, #ffb94b, #fddb6f);
    background-image: -moz-linear-gradient(top, #ffb94b, #fddb6f);
    background-image: -ms-linear-gradient(top, #ffb94b, #fddb6f);
    background-image: -o-linear-gradient(top, #ffb94b, #fddb6f);
    background-image: linear-gradient(top, #ffb94b, #fddb6f);
}	

#submit:active
{		
    outline: none;
   
     -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5) inset;
     -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5) inset;
     box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5) inset;		
}

#submit::-moz-focus-inner
{
  border: none;
}

#actions a
{
    color: #3151A2;    
    float: right;
    line-height: 35px;
    margin-left: 10px;
}

/*--------------------*/

#back
{
    display: block;
    text-align: center;
    position: relative;
    top: 60px;
    color: #999;
}


</style>
<script language="javascript">  

//验证是否为数字   
function IsDigit(cCheck)      
 {      
 return (('0'<=cCheck) && (cCheck<='9'));      
 }     

//验证是否为英文字母 
      
function IsAlpha(cCheck)      
 {      
 return ((('a'<=cCheck) && (cCheck<='z')) || (('A'<=cCheck) && (cCheck<='Z')))      
 }               
 //验证是否为空      
function IsaNull(cCheck)           
 {           
 return(cCheck != " ")          
 }     

//表单验证函数
function checkform()      
{ 
  //验证用户名是否为空
  username = document.form1.username.value;      
 if (username == "")      
  {      
  alert("请输入用户名");      
  document.form1.username.focus();      
  return false;      
  }    

验证：用户名必须为英文字母、数字以及_组成

for (nIndex=0; nIndex<username.length; nIndex++)      
  {      
  cCheck = username.charAt(nIndex);      
  if (!(IsDigit(cCheck) || IsAlpha(cCheck) || cCheck=='_' ))      
   {      
   alert("用户名只能使用字母、数字以及-、_和.，并且不能使用中文");      
   document.sform1.id.focus();      
   return false;      
   }      
  }  
  
      
 //验证密码字段是否为空
 password = document.form1.password.value;      
 if (password == "")      
  {      
  alert("请输入登陆密码");      
  document.form1.password.focus();      
  return false;      
  }  

//验证密码字段两次输入是否相同

 password1 = document.form1.password1.value;      
 if (password>password1)      
  { 
     alert("重复密码与登陆密码不相同");      
  document.form1.password.focus();  
  document.form1.password1.focus();      
  return false; 
  }   
if (password<password1)      
  { 
     alert("重复密码与登陆密码不相同");      
  document.sform1.password.focus();  
  document.sform1.password1.focus();      
  return false; 
  }  

//验证email字段是否为空

 if (document.form1.email.value == "")      
  {      
  alert("请输入您的E-MAIL地址");      
  document.form1.email.focus();      
  return false;      
  }      
 

//验证email字段输入是否合法
    
 email=document.form1.email.value;       
 emailerr=0      
 for (i=0; i<email.length; i++)      
  {      
  if ((email.charAt(i) == "@") & (email.length > 5))      
   {      
     emailerr=emailerr+1      
   }      
  }      
 if (emailerr != 1)      
  {      
  alert("请输入正确的E-MAIL地址");      
  document.form1.email.focus();      
  return false;      
  }            
   
 if (document.form1.checkask.value=="")  
  {  
   alert("密码提示问题不能为空");      
   document.form1.checkask.focus();      
   return false;   
  }  
 if (document.form1.checkans.value=="")  
  {  
   alert("您的密码提示问题答案不能为空");  
   document.form1.checkans.focus();      
   return false;   
  }
 return true;      
      
}  
function register()
{
 alert("验证信息已发送至邮箱，请激活！"); 
}
</script>


</head>
<body>

    <form id="login">
     <div>
     <fieldset id="inputs">
     <table width="30%" align="center">
     	<tr>
        	<td><h1>新用户注册</h1></td>
     	</tr>
        <tr>
            <td><input type="text" placeholder="用户名"/></td>
      	</tr>
        <tr>
        	<td><input type="password" placeholder="密码"/></td>
     	</tr> 
        <tr>
        	<td><input type="password" placeholder="确认密码"/></td>
     	</tr> 
		<tr>
        	<td><input type="text" placeholder="昵称"/></td>
     	</tr>  
        <tr>
        	<td><input type="text" placeholder="邮箱"/></td>
     	</tr> 
         
		<tr>
        	<td><input type="text" placeholder="年龄"/></td>
     	</tr>
		<tr>
        	<td><input type="text" placeholder="兴趣爱好"/></td>
     	</tr> 
		<tr>
        	<td><input type="file" value="上传头像" style="height:30px"/></td>
     	</tr>  
        <tr>
        	<td> 
                <input type="radio" name="sex" value="1" style="width:20px"/>男
				<input type="radio" name="sex" value="2" style="width:20px"/>女
			</td>
     	</tr>  
		 
		<tr>
        	<td> 
                <select>
				  <option value ="volvo">广西</option>
				  <option value ="saab">广东</option>
				</select>
				<select>
				  <option value ="volvo">南宁</option>
				  <option value ="saab">桂林</option>
				</select>
			</td>
     	</tr>
				
		

     </table>
     </fieldset>
     <fieldset id="actions">
     <table width="30%" align="center">
        <tr>
            <td>
             <input type="submit" value="       注册       "/>
            </td>
        </tr>
   
    </table>
    </fieldset>
  
     </div>
    </form>
</body>
</html>
